home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Database How-To / Visual Basic 4 Database - How-to (The Waite Group)(1995).iso / login.fr_ / login.fr
Text File  |  1995-07-19  |  23KB  |  757 lines

  1. VERSION 4.00
  2. Begin VB.Form frmODBC 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "Update Visual Basic ODBC Settings"
  5.    ClientHeight    =   5610
  6.    ClientLeft      =   1665
  7.    ClientTop       =   1980
  8.    ClientWidth     =   7920
  9.    Height          =   6105
  10.    Left            =   1560
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   5610
  13.    ScaleWidth      =   7920
  14.    Top             =   1590
  15.    Width           =   8130
  16.    Begin VB.CommandButton cmdQuit 
  17.       Caption         =   "Quit"
  18.       Height          =   495
  19.       Left            =   6360
  20.       TabIndex        =   59
  21.       Top             =   1320
  22.       Width           =   1215
  23.    End
  24.    Begin VB.CommandButton cmdUpdate 
  25.       Caption         =   "Update"
  26.       Height          =   495
  27.       Left            =   6360
  28.       TabIndex        =   58
  29.       Top             =   600
  30.       Width           =   1215
  31.    End
  32.    Begin VB.TextBox txtNew 
  33.       Height          =   285
  34.       Index           =   13
  35.       Left            =   3480
  36.       TabIndex        =   56
  37.       Top             =   5160
  38.       Width           =   1000
  39.    End
  40.    Begin VB.TextBox txtCurrent 
  41.       BackColor       =   &H00C0C0C0&
  42.       Height          =   285
  43.       Index           =   13
  44.       Left            =   2160
  45.       TabIndex        =   55
  46.       TabStop         =   0   'False
  47.       Top             =   5160
  48.       Width           =   1000
  49.    End
  50.    Begin VB.TextBox txtNew 
  51.       Height          =   285
  52.       Index           =   12
  53.       Left            =   3480
  54.       TabIndex        =   52
  55.       Top             =   4800
  56.       Width           =   1000
  57.    End
  58.    Begin VB.TextBox txtCurrent 
  59.       BackColor       =   &H00C0C0C0&
  60.       Height          =   285
  61.       Index           =   12
  62.       Left            =   2160
  63.       TabIndex        =   51
  64.       TabStop         =   0   'False
  65.       Top             =   4800
  66.       Width           =   1000
  67.    End
  68.    Begin VB.TextBox txtNew 
  69.       Height          =   285
  70.       Index           =   11
  71.       Left            =   3480
  72.       TabIndex        =   48
  73.       Top             =   4440
  74.       Width           =   1000
  75.    End
  76.    Begin VB.TextBox txtCurrent 
  77.       BackColor       =   &H00C0C0C0&
  78.       Height          =   285
  79.       Index           =   11
  80.       Left            =   2160
  81.       TabIndex        =   47
  82.       TabStop         =   0   'False
  83.       Top             =   4440
  84.       Width           =   1000
  85.    End
  86.    Begin VB.TextBox txtNew 
  87.       Height          =   285
  88.       Index           =   10
  89.       Left            =   3480
  90.       TabIndex        =   44
  91.       Top             =   4080
  92.       Width           =   1000
  93.    End
  94.    Begin VB.TextBox txtCurrent 
  95.       BackColor       =   &H00C0C0C0&
  96.       Height          =   285
  97.       Index           =   10
  98.       Left            =   2160
  99.       TabIndex        =   43
  100.       TabStop         =   0   'False
  101.       Top             =   4080
  102.       Width           =   1000
  103.    End
  104.    Begin VB.TextBox txtNew 
  105.       Height          =   285
  106.       Index           =   9
  107.       Left            =   3480
  108.       TabIndex        =   40
  109.       Top             =   3720
  110.       Width           =   1000
  111.    End
  112.    Begin VB.TextBox txtCurrent 
  113.       BackColor       =   &H00C0C0C0&
  114.       Height          =   285
  115.       Index           =   9
  116.       Left            =   2160
  117.       TabIndex        =   39
  118.       TabStop         =   0   'False
  119.       Top             =   3720
  120.       Width           =   1000
  121.    End
  122.    Begin VB.TextBox txtNew 
  123.       Height          =   285
  124.       Index           =   8
  125.       Left            =   3480
  126.       TabIndex        =   36
  127.       Top             =   3360
  128.       Width           =   1000
  129.    End
  130.    Begin VB.TextBox txtCurrent 
  131.       BackColor       =   &H00C0C0C0&
  132.       Height          =   285
  133.       Index           =   8
  134.       Left            =   2160
  135.       TabIndex        =   35
  136.       TabStop         =   0   'False
  137.       Top             =   3360
  138.       Width           =   1000
  139.    End
  140.    Begin VB.TextBox txtNew 
  141.       Height          =   285
  142.       Index           =   7
  143.       Left            =   3480
  144.       TabIndex        =   32
  145.       Top             =   3000
  146.       Width           =   1000
  147.    End
  148.    Begin VB.TextBox txtCurrent 
  149.       BackColor       =   &H00C0C0C0&
  150.       Height          =   285
  151.       Index           =   7
  152.       Left            =   2160
  153.       TabIndex        =   31
  154.       TabStop         =   0   'False
  155.       Top             =   3000
  156.       Width           =   1000
  157.    End
  158.    Begin VB.TextBox txtNew 
  159.       Height          =   285
  160.       Index           =   6
  161.       Left            =   3480
  162.       TabIndex        =   28
  163.       Top             =   2640
  164.       Width           =   1000
  165.    End
  166.    Begin VB.TextBox txtCurrent 
  167.       BackColor       =   &H00C0C0C0&
  168.       Height          =   285
  169.       Index           =   6
  170.       Left            =   2160
  171.       TabIndex        =   27
  172.       TabStop         =   0   'False
  173.       Top             =   2640
  174.       Width           =   1000
  175.    End
  176.    Begin VB.TextBox txtNew 
  177.       Height          =   285
  178.       Index           =   5
  179.       Left            =   3480
  180.       TabIndex        =   24
  181.       Top             =   2280
  182.       Width           =   1000
  183.    End
  184.    Begin VB.TextBox txtCurrent 
  185.       BackColor       =   &H00C0C0C0&
  186.       Height          =   285
  187.       Index           =   5
  188.       Left            =   2160
  189.       TabIndex        =   23
  190.       TabStop         =   0   'False
  191.       Top             =   2280
  192.       Width           =   1000
  193.    End
  194.    Begin VB.TextBox txtNew 
  195.       Height          =   285
  196.       Index           =   4
  197.       Left            =   3480
  198.       TabIndex        =   20
  199.       Top             =   1920
  200.       Width           =   1000
  201.    End
  202.    Begin VB.TextBox txtCurrent 
  203.       BackColor       =   &H00C0C0C0&
  204.       Height          =   285
  205.       Index           =   4
  206.       Left            =   2160
  207.       TabIndex        =   19
  208.       TabStop         =   0   'False
  209.       Top             =   1920
  210.       Width           =   1000
  211.    End
  212.    Begin VB.TextBox txtNew 
  213.       Height          =   285
  214.       Index           =   3
  215.       Left            =   3480
  216.       TabIndex        =   16
  217.       Top             =   1560
  218.       Width           =   1000
  219.    End
  220.    Begin VB.TextBox txtCurrent 
  221.       BackColor       =   &H00C0C0C0&
  222.       Height          =   285
  223.       Index           =   3
  224.       Left            =   2160
  225.       TabIndex        =   15
  226.       TabStop         =   0   'False
  227.       Top             =   1560
  228.       Width           =   1000
  229.    End
  230.    Begin VB.TextBox txtNew 
  231.       Height          =   285
  232.       Index           =   2
  233.       Left            =   3480
  234.       TabIndex        =   12
  235.       Top             =   1200
  236.       Width           =   1000
  237.    End
  238.    Begin VB.TextBox txtCurrent 
  239.       BackColor       =   &H00C0C0C0&
  240.       Height          =   285
  241.       Index           =   2
  242.       Left            =   2160
  243.       TabIndex        =   11
  244.       TabStop         =   0   'False
  245.       Top             =   1200
  246.       Width           =   1000
  247.    End
  248.    Begin VB.TextBox txtNew 
  249.       Height          =   285
  250.       Index           =   1
  251.       Left            =   3480
  252.       TabIndex        =   8
  253.       Top             =   840
  254.       Width           =   1000
  255.    End
  256.    Begin VB.TextBox txtCurrent 
  257.       BackColor       =   &H00C0C0C0&
  258.       Height          =   285
  259.       Index           =   1
  260.       Left            =   2160
  261.       TabIndex        =   7
  262.       TabStop         =   0   'False
  263.       Top             =   840
  264.       Width           =   1000
  265.    End
  266.    Begin VB.TextBox txtNew 
  267.       Height          =   285
  268.       Index           =   0
  269.       Left            =   3480
  270.       TabIndex        =   4
  271.       Top             =   480
  272.       Width           =   1000
  273.    End
  274.    Begin VB.TextBox txtCurrent 
  275.       BackColor       =   &H00C0C0C0&
  276.       Height          =   285
  277.       Index           =   0
  278.       Left            =   2160
  279.       TabIndex        =   3
  280.       TabStop         =   0   'False
  281.       Top             =   480
  282.       Width           =   1000
  283.    End
  284.    Begin MSComDlg.CommonDialog cdOpen 
  285.       Left            =   6360
  286.       Top             =   0
  287.       _Version        =   65536
  288.       _ExtentX        =   847
  289.       _ExtentY        =   847
  290.       _StockProps     =   0
  291.       DefaultExt      =   "ini"
  292.       DialogTitle     =   "Select INI file to Modify"
  293.       FileName        =   "*.ini"
  294.       Filter          =   "INI Files  (*.ini)"
  295.    End
  296.    Begin VB.Label lblUnits 
  297.       BackColor       =   &H00C0C0C0&
  298.       Height          =   255
  299.       Index           =   13
  300.       Left            =   4800
  301.       TabIndex        =   57
  302.       Top             =   5160
  303.       Width           =   1200
  304.    End
  305.    Begin VB.Label lblSetting 
  306.       Alignment       =   1  'Right Justify
  307.       BackColor       =   &H00C0C0C0&
  308.       Height          =   255
  309.       Index           =   13
  310.       Left            =   240
  311.       TabIndex        =   54
  312.       Top             =   5160
  313.       Width           =   1700
  314.    End
  315.    Begin VB.Label lblUnits 
  316.       BackColor       =   &H00C0C0C0&
  317.       Height          =   255
  318.       Index           =   12
  319.       Left            =   4800
  320.       TabIndex        =   53
  321.       Top             =   4800
  322.       Width           =   1200
  323.    End
  324.    Begin VB.Label lblSetting 
  325.       Alignment       =   1  'Right Justify
  326.       BackColor       =   &H00C0C0C0&
  327.       Height          =   255
  328.       Index           =   12
  329.       Left            =   240
  330.       TabIndex        =   50
  331.       Top             =   4800
  332.       Width           =   1700
  333.    End
  334.    Begin VB.Label lblUnits 
  335.       BackColor       =   &H00C0C0C0&
  336.       Height          =   255
  337.       Index           =   11
  338.       Left            =   4800
  339.       TabIndex        =   49
  340.       Top             =   4440
  341.       Width           =   1200
  342.    End
  343.    Begin VB.Label lblSetting 
  344.       Alignment       =   1  'Right Justify
  345.       BackColor       =   &H00C0C0C0&
  346.       Height          =   255
  347.       Index           =   11
  348.       Left            =   240
  349.       TabIndex        =   46
  350.       Top             =   4440
  351.       Width           =   1700
  352.    End
  353.    Begin VB.Label lblUnits 
  354.       BackColor       =   &H00C0C0C0&
  355.       Height          =   255
  356.       Index           =   10
  357.       Left            =   4800
  358.       TabIndex        =   45
  359.       Top             =   4080
  360.       Width           =   1200
  361.    End
  362.    Begin VB.Label lblSetting 
  363.       Alignment       =   1  'Right Justify
  364.       BackColor       =   &H00C0C0C0&
  365.       Height          =   255
  366.       Index           =   10
  367.       Left            =   240
  368.       TabIndex        =   42
  369.       Top             =   4080
  370.       Width           =   1700
  371.    End
  372.    Begin VB.Label lblUnits 
  373.       BackColor       =   &H00C0C0C0&
  374.       Height          =   255
  375.       Index           =   9
  376.       Left            =   4800
  377.       TabIndex        =   41
  378.       Top             =   3720
  379.       Width           =   1200
  380.    End
  381.    Begin VB.Label lblSetting 
  382.       Alignment       =   1  'Right Justify
  383.       BackColor       =   &H00C0C0C0&
  384.       Height          =   255
  385.       Index           =   9
  386.       Left            =   240
  387.       TabIndex        =   38
  388.       Top             =   3720
  389.       Width           =   1700
  390.    End
  391.    Begin VB.Label lblUnits 
  392.       BackColor       =   &H00C0C0C0&
  393.       Height          =   255
  394.       Index           =   8
  395.       Left            =   4800
  396.       TabIndex        =   37
  397.       Top             =   3360
  398.       Width           =   1200
  399.    End
  400.    Begin VB.Label lblSetting 
  401.       Alignment       =   1  'Right Justify
  402.       BackColor       =   &H00C0C0C0&
  403.       Height          =   255
  404.       Index           =   8
  405.       Left            =   240
  406.       TabIndex        =   34
  407.       Top             =   3360
  408.       Width           =   1700
  409.    End
  410.    Begin VB.Label lblUnits 
  411.       BackColor       =   &H00C0C0C0&
  412.       Height          =   255
  413.       Index           =   7
  414.       Left            =   4800
  415.       TabIndex        =   33
  416.       Top             =   3000
  417.       Width           =   1200
  418.    End
  419.    Begin VB.Label lblSetting 
  420.       Alignment       =   1  'Right Justify
  421.       BackColor       =   &H00C0C0C0&
  422.       Height          =   255
  423.       Index           =   7
  424.       Left            =   240
  425.       TabIndex        =   30
  426.       Top             =   3000
  427.       Width           =   1700
  428.    End
  429.    Begin VB.Label lblUnits 
  430.       BackColor       =   &H00C0C0C0&
  431.       Height          =   255
  432.       Index           =   6
  433.       Left            =   4800
  434.       TabIndex        =   29
  435.       Top             =   2640
  436.       Width           =   1200
  437.    End
  438.    Begin VB.Label lblSetting 
  439.       Alignment       =   1  'Right Justify
  440.       BackColor       =   &H00C0C0C0&
  441.       Height          =   255
  442.       Index           =   6
  443.       Left            =   240
  444.       TabIndex        =   26
  445.       Top             =   2640
  446.       Width           =   1700
  447.    End
  448.    Begin VB.Label lblUnits 
  449.       BackColor       =   &H00C0C0C0&
  450.       Height          =   255
  451.       Index           =   5
  452.       Left            =   4800
  453.       TabIndex        =   25
  454.       Top             =   2280
  455.       Width           =   1200
  456.    End
  457.    Begin VB.Label lblSetting 
  458.       Alignment       =   1  'Right Justify
  459.       BackColor       =   &H00C0C0C0&
  460.       Height          =   255
  461.       Index           =   5
  462.       Left            =   240
  463.       TabIndex        =   22
  464.       Top             =   2280
  465.       Width           =   1700
  466.    End
  467.    Begin VB.Label lblUnits 
  468.       BackColor       =   &H00C0C0C0&
  469.       Height          =   255
  470.       Index           =   4
  471.       Left            =   4800
  472.       TabIndex        =   21
  473.       Top             =   1920
  474.       Width           =   1200
  475.    End
  476.    Begin VB.Label lblSetting 
  477.       Alignment       =   1  'Right Justify
  478.       BackColor       =   &H00C0C0C0&
  479.       Height          =   255
  480.       Index           =   4
  481.       Left            =   240
  482.       TabIndex        =   18
  483.       Top             =   1920
  484.       Width           =   1700
  485.    End
  486.    Begin VB.Label lblUnits 
  487.       BackColor       =   &H00C0C0C0&
  488.       Height          =   255
  489.       Index           =   3
  490.       Left            =   4800
  491.       TabIndex        =   17
  492.       Top             =   1560
  493.       Width           =   1200
  494.    End
  495.    Begin VB.Label lblSetting 
  496.       Alignment       =   1  'Right Justify
  497.       BackColor       =   &H00C0C0C0&
  498.       Height          =   255
  499.       Index           =   3
  500.       Left            =   240
  501.       TabIndex        =   14
  502.       Top             =   1560
  503.       Width           =   1700
  504.    End
  505.    Begin VB.Label lblUnits 
  506.       BackColor       =   &H00C0C0C0&
  507.       Height          =   255
  508.       Index           =   2
  509.       Left            =   4800
  510.       TabIndex        =   13
  511.       Top             =   1200
  512.       Width           =   1200
  513.    End
  514.    Begin VB.Label lblSetting 
  515.       Alignment       =   1  'Right Justify
  516.       BackColor       =   &H00C0C0C0&
  517.       Height          =   255
  518.       Index           =   2
  519.       Left            =   240
  520.       TabIndex        =   10
  521.       Top             =   1200
  522.       Width           =   1700
  523.    End
  524.    Begin VB.Label lblUnits 
  525.       BackColor       =   &H00C0C0C0&
  526.       Height          =   255
  527.       Index           =   1
  528.       Left            =   4800
  529.       TabIndex        =   9
  530.       Top             =   840
  531.       Width           =   1200
  532.    End
  533.    Begin VB.Label lblSetting 
  534.       Alignment       =   1  'Right Justify
  535.       BackColor       =   &H00C0C0C0&
  536.       Height          =   255
  537.       Index           =   1
  538.       Left            =   240
  539.       TabIndex        =   6
  540.       Top             =   840
  541.       Width           =   1700
  542.    End
  543.    Begin VB.Label lblUnits 
  544.       BackColor       =   &H00C0C0C0&
  545.       Height          =   255
  546.       Index           =   0
  547.       Left            =   4800
  548.       TabIndex        =   5
  549.       Top             =   480
  550.       Width           =   1200
  551.    End
  552.    Begin VB.Label Label2 
  553.       Alignment       =   2  'Center
  554.       BackColor       =   &H00C0C0C0&
  555.       Caption         =   "New"
  556.       Height          =   255
  557.       Left            =   3480
  558.       TabIndex        =   2
  559.       Top             =   120
  560.       Width           =   1000
  561.    End
  562.    Begin VB.Label Label1 
  563.       Alignment       =   2  'Center
  564.       BackColor       =   &H00C0C0C0&
  565.       Caption         =   "Current"
  566.       Height          =   255
  567.       Left            =   2160
  568.       TabIndex        =   1
  569.       Top             =   120
  570.       Width           =   1005
  571.    End
  572.    Begin VB.Label lblSetting 
  573.       Alignment       =   1  'Right Justify
  574.       BackColor       =   &H00C0C0C0&
  575.       Height          =   255
  576.       Index           =   0
  577.       Left            =   240
  578.       TabIndex        =   0
  579.       Top             =   480
  580.       Width           =   1700
  581.    End
  582. End
  583. Attribute VB_Name = "frmODBC"
  584. Attribute VB_Creatable = False
  585. Attribute VB_Exposed = False
  586. Option Explicit
  587.  
  588. Dim iniName As String
  589. Dim arrayMax As Integer
  590.  
  591. Private Sub cmdQuit_Click()
  592.     End
  593. End Sub
  594.  
  595. Private Sub cmdUpdate_Click()
  596.     Dim i As Integer
  597.     Dim result As Integer
  598.     Dim counter As Integer
  599.     Dim setting As String
  600.     
  601.     result = MsgBox("Are you sure you want to write changes to " & iniName & "?", 4, "WARNING!")
  602.     If result = 7 Then
  603.         End
  604.     End If
  605.     
  606.     'Run through the control array, checking to see if there
  607.     'have been any entries that should be entered into the INI
  608.     'file.
  609.     counter = 0
  610.     For i = 0 To arrayMax
  611.         If Len(txtNew(i).TEXT) Then
  612.             setting = Trim(txtNew(i).TEXT)
  613.             result = WritePrivateProfileString("ODBC", lblSetting(i).Caption, ByVal setting, iniName)
  614.             counter = counter + 1
  615.         End If
  616.     Next
  617.     
  618.     If counter Then
  619.         'Reload the current settings so that the current
  620.         'column reflects the actual, updated settings in
  621.         'the file.
  622.         loadSettings
  623.     Else
  624.         'Nothing was entered to change
  625.         MsgBox "No changes were entered, so nothing changed."
  626.     End If
  627. End Sub
  628.  
  629. Private Sub Form_Load()
  630.     Dim result As Integer
  631.     Dim winDirName As String * 256
  632.     Dim lenDirName As Integer
  633.     arrayMax = 13
  634.  
  635.     result = MsgBox("Running this program will cause the default settings to be written to VB.INI. Proceed?", 4, "WARNING!")
  636.     If result = 7 Then
  637.         End
  638.     End If
  639.  
  640.     'Get the name of the Windows directory
  641.     lenDirName = GetWindowsDirectory(winDirName, Len(winDirName))
  642.     If lenDirName = 0 Then
  643.         MsgBox "Error occurred getting Windows directory name. Exiting procedure."
  644.         Unload Me
  645.     End If
  646.     
  647.     'Need to get the file to use: VB.INI or the <app>.INI
  648.     cdOpen.InitDir = Left(winDirName, lenDirName)
  649.     cdOpen.CancelError = True
  650.     On Error GoTo cdCancelError
  651.     cdOpen.ShowOpen
  652.     On Error GoTo 0
  653.     
  654.     iniName = cdOpen.filename
  655.     
  656.     loadSettings
  657.  
  658. ExitSubroutine:
  659.     Exit Sub
  660.  
  661. cdCancelError:
  662.     If Err.Number = cdlCancel Then
  663.         'User pressed Cancel, so quit the program
  664.         Unload Me
  665.     Else
  666.         Error Err.Number
  667.         Resume ExitSubroutine
  668.     End If
  669. End Sub
  670.  
  671. Sub loadSettings()
  672.     'Load the control array
  673.     
  674.     lblSetting(0).Caption = "TraceSQLMode"
  675.     txtCurrent(0).TEXT = GetCurrentInt(lblSetting(0).Caption, 0)
  676.     lblUnits(0).Caption = "True/False"
  677.     txtNew(0).TEXT = ""
  678.     
  679.     lblSetting(1).Caption = "TraceODBCAPI"
  680.     txtCurrent(1).TEXT = GetCurrentInt(lblSetting(1).Caption, 0)
  681.     lblUnits(1).Caption = "True/False"
  682.     txtNew(1).TEXT = ""
  683.  
  684.     lblSetting(2).Caption = "DisableAsync"
  685.     txtCurrent(2).TEXT = GetCurrentInt(lblSetting(2).Caption, 0)
  686.     lblUnits(2).Caption = "True/False"
  687.     txtNew(2).TEXT = ""
  688.  
  689.     lblSetting(3).Caption = "LoginTimeout"
  690.     txtCurrent(3).TEXT = GetCurrentInt(lblSetting(3).Caption, 20)
  691.     lblUnits(3).Caption = "Seconds"
  692.     txtNew(3).TEXT = ""
  693.  
  694.     lblSetting(4).Caption = "QueryTimeout"
  695.     txtCurrent(4).TEXT = GetCurrentInt(lblSetting(4).Caption, 60)
  696.     lblUnits(4).Caption = "Seconds"
  697.     txtNew(4).TEXT = ""
  698.  
  699.     lblSetting(5).Caption = "ConnectionTimeout"
  700.     txtCurrent(5).TEXT = GetCurrentInt(lblSetting(5).Caption, 600)
  701.     lblUnits(5).Caption = "Seconds"
  702.     txtNew(5).TEXT = ""
  703.  
  704.     lblSetting(6).Caption = "AsyncRetryInterval"
  705.     txtCurrent(6).TEXT = GetCurrentInt(lblSetting(6).Caption, 500)
  706.     lblUnits(6).Caption = "Seconds"
  707.     txtNew(6).TEXT = ""
  708.  
  709.     lblSetting(7).Caption = "AttachCaseSensitive"
  710.     txtCurrent(7).TEXT = GetCurrentInt(lblSetting(7).Caption, 0)
  711.     lblUnits(7).Caption = "True/False"
  712.     txtNew(7).TEXT = ""
  713.  
  714.     lblSetting(8).Caption = "SnapshotOnly"
  715.     txtCurrent(8).TEXT = GetCurrentInt(lblSetting(8).Caption, 0)
  716.     lblUnits(8).Caption = "True/False"
  717.     txtNew(8).TEXT = ""
  718.  
  719.     lblSetting(9).Caption = "TryJetAuth"
  720.     txtCurrent(9).TEXT = GetCurrentInt(lblSetting(9).Caption, 1)
  721.     lblUnits(9).Caption = "Yes/No"
  722.     txtNew(9).TEXT = ""
  723.  
  724.     lblSetting(10).Caption = "PreparedInsert"
  725.     txtCurrent(10).TEXT = GetCurrentInt(lblSetting(10).Caption, 0)
  726.     lblUnits(10).Caption = "True/False"
  727.     txtNew(10).TEXT = ""
  728.  
  729.     lblSetting(11).Caption = "PreparedUpdate"
  730.     txtCurrent(11).TEXT = GetCurrentInt(lblSetting(11).Caption, 0)
  731.     lblUnits(11).Caption = "Yes/No"
  732.     txtNew(11).TEXT = ""
  733.  
  734.     lblSetting(12).Caption = "FastRequery"
  735.     txtCurrent(12).TEXT = GetCurrentInt(lblSetting(12).Caption, 0)
  736.     lblUnits(12).Caption = "Yes/No"
  737.     txtNew(12).TEXT = ""
  738.  
  739.     lblSetting(13).Caption = "AttachableObjects"
  740.     txtCurrent(13).TEXT = GetCurrentStr(lblSetting(13).Caption, "'TABLE', 'VIEW', 'SYSTEM TABLE', 'ALIAS', 'SYNONYM'")
  741.     lblUnits(13).Caption = ""
  742.     txtNew(13).TEXT = ""
  743.  
  744. End Sub
  745.  
  746. Function GetCurrentInt(lineName As String, defValue As Integer) As Integer
  747.     GetCurrentInt = GetPrivateProfileInt("ODBC", lineName, defValue, iniName)
  748. End Function
  749. Function GetCurrentStr(lineName As String, defValue As String) As String
  750.     Dim retStr As String * 256
  751.     Dim result As Integer
  752.     
  753.     result = GetPrivateProfileString("ODBC", lineName, defValue, retStr, Len(retStr), iniName)
  754.     GetCurrentStr = retStr
  755. End Function
  756.  
  757.